package week1;
import java.util.Scanner;
public abstract class Timu2 {

	public static void main(String[] args) {
		Scanner in=new Scanner(System.in);
		int a=in.nextInt();
		if(a>=10000&&a<=20000)
		{
			System.out.println(Integer.toBinaryString(a));
			System.out.println(Integer.toOctalString(a));
			System.out.println(Integer.toHexString(a));
			
		}
		else 
		{
			String st =String.valueOf(a);
			char[] b=st.toCharArray();
			int sum =0;
			int i;
			for(i=0;i<st.length();i++)
			{
				if (b[i]=='-'||b[i]=='.'||b[i]==' ')
				continue;
				else
				{
					 System.out.println(b[i]);
					 sum+=b[i];
				}
				
			}System.out.println(sum);
			   
			}
			
	}

}
